/*
 * palindrome.cpp
 *
 *  Created on: Jul 17, 2012
 *      Author: xkq
 */

#include <iostream>

using namespace std;

/*Determine whether an integer is a palindrome. Do this without extra space.*/
bool isPalindrome(int x){
	if(x<0) return false;
	int div = 1;
	while(x/div>10)
		div*=10;
	while(x!=0){
		if(x%10!=x/div)
			return false;
		else{
			div=div/100;
			x=(x/10)%div;
		}
	}
	return true;
}


